import java.io.IOException;

import com.epam.kozich.model.Administrator;
import com.epam.kozich.model.Book;
import com.epam.kozich.model.Person;
import com.epam.kozich.model.PersonManager;

public class Runner {

	/**
	 * @param args
	 * @throws IOException 
	 */
	public static void main(String[] args) throws IOException {
		Person personal = new Person("name", "password");
		Person person2 = new Person("Elf", "password");
		person2.setInBlackList(true);
		PersonManager pm = new PersonManager();
		
		Book book = new Book("Dzen Ejr", "Ostin", 1992);
		Administrator admin = new Administrator();
		pm.addPerson(personal);
		pm.addPerson(person2);
		pm.addPerson(admin);
		
		OrderManager order = new OrderManager();
		admin.addToBlackList(personal);
		order.zakaz(personal, book);
		order.zakaz(person2,book);
		for (Person person : pm.getListPerson()) {
			if(person.isInBlackList()){
				System.out.println(person.getLogin() + "BLACK");
			}else{
				System.out.println("OK");
			}
		}
		admin.inFile();

	}
}